package com.ruoyi.common.constant.material;

public class PurchaseConstants {

    public enum TypeEnum {

        Manufacturer("从生产企业采购", "Manufacturer"),
        BusinessUnit("从经营单位采购", "BusinessUnit"),
        FoodProducer("食用农产品生产者", "FoodProducer"),
        Butcher("屠宰企业", "Butcher"),
        SelfEmployed("个体工商户", "SelfEmployed"),
        ;

        private final String typeName;
        private final String typeValue;

        TypeEnum(String typeName, String typeValue) {
            this.typeName = typeName;
            this.typeValue = typeValue;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public String getTypeValue() {
            return this.typeValue;
        }

        public static String getTypeNameByValue(String typeValue) {
            for (TypeEnum purchaseTypeEnum : TypeEnum.values()) {
                if (purchaseTypeEnum.getTypeValue().equals(typeValue)) {
                    return purchaseTypeEnum.getTypeName();
                }
            }
            return null;
        }
    }


    public enum StatusEnum {

        ToBeAccepted("待验收", "ToBeAccepted"),
        Accepted("已验收", "Accepted"),
        Refused("被拒绝", "Refused"),
        ;

        private final String typeName;
        private final String typeValue;

        StatusEnum(String typeName, String typeValue) {
            this.typeName = typeName;
            this.typeValue = typeValue;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public String getTypeValue() {
            return this.typeValue;
        }

        public static String getTypeNameByValue(String typeValue) {
            for (StatusEnum item : StatusEnum.values()) {
                if (item.getTypeValue().equals(typeValue)) {
                    return item.getTypeName();
                }
            }
            return null;
        }
    }

    public enum WarehouseStatusEnum {

        ToBeIn("待入库", "ToBeIn"),
        Complete("完成入库", "Complete"),
        Part("部分入库", "Part"),
        ;

        private final String typeName;
        private final String typeValue;

        WarehouseStatusEnum(String typeName, String typeValue) {
            this.typeName = typeName;
            this.typeValue = typeValue;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public String getTypeValue() {
            return this.typeValue;
        }

        public static String getTypeNameByValue(String typeValue) {
            for (WarehouseStatusEnum item : WarehouseStatusEnum.values()) {
                if (item.getTypeValue().equals(typeValue)) {
                    return item.getTypeName();
                }
            }
            return null;
        }
    }

    public enum FoodTypeEnum {

        Food("食品", "Food"),
        FoodFarm("食用农产品", "FoodFarm"),
        FoodAdd("食品添加剂", "FoodAdd"),
        FoodRelate("食品相关", "FoodRelate"),
        ;

        private final String typeName;
        private final String typeValue;

        FoodTypeEnum(String typeName, String typeValue) {
            this.typeName = typeName;
            this.typeValue = typeValue;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public String getTypeValue() {
            return this.typeValue;
        }

        public static String getTypeNameByValue(String typeValue) {
            for (FoodTypeEnum item : FoodTypeEnum.values()) {
                if (item.getTypeValue().equals(typeValue)) {
                    return item.getTypeName();
                }
            }
            return null;
        }
    }

    public enum StockTypeEnum {

        In("入库变动", "In"),
        Out("出库变动", "Out"),
        In_del("入库删除变动", "In_del"),
        Out_del("出库删除变动", "Out_del"),
        ;

        private final String typeName;
        private final String typeValue;

        StockTypeEnum(String typeName, String typeValue) {
            this.typeName = typeName;
            this.typeValue = typeValue;
        }

        public String getTypeName() {
            return this.typeName;
        }

        public String getTypeValue() {
            return this.typeValue;
        }

        public static String getTypeNameByValue(String typeValue) {
            for (StockTypeEnum item : StockTypeEnum.values()) {
                if (item.getTypeValue().equals(typeValue)) {
                    return item.getTypeName();
                }
            }
            return null;
        }
    }


}
